package com.gome.ocean.common.enums.job;

/**
 * 读取插件
 * 
 * @author haqiaolong 2016年1月21日 下午4:55:47
 * @since 5.0.0
 */
public enum Reader {
    DRDS(0), MONGODB(1), MYSQL(2), ORACLE(3), HDFS(4), HBASE(5), SQLSERVER(7);

    private int value;

    private Reader(int value){
        this.value = value;
    }

    public static Reader getReader(int value) {
        for (Reader reader : Reader.values()) {
            if (reader.getValue() == value) {
                return reader;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }

    public static String getString(Reader reader) {
        switch (reader) {
            case DRDS:
                return "Drds";
            case MONGODB:
                return "MongoDB";
            case MYSQL:
                return "Mysql";
            case ORACLE:
                return "Oracle";
            case HDFS:
                return "Hdfs";
            case HBASE:
                return "Hbase";
            case SQLSERVER:
                return "Sqlserver";
        }
        return null;
    }
}
